package net.maku.needy.consts;

/**
 * @author Administrator
 */
public enum DifficultyTypeEnum {

    /**
     * 金秋助学
     */
    ASSIST_LEARNING("金秋助学",1),
    /**
     * 生育补贴
     */
    BIRTH_ALLOWANCE("生育补贴",2),
    /**
     * 结婚补助
     */
    MARRIAGE_ALLOWANCE("结婚补助",3),
    /**
     * 大病救助
     */
    SICK_ASSISTANCE("大病救助",4),
    /**
     * 亲属去世慰问
     */
    RELATIVES_PASSED_AWAY_CONDOLENCE("亲属去世慰问",5),
    /**
     * 法律援助
     */
    LEGAL_AID("法律援助",6);
    private String name;
    private Integer value;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    DifficultyTypeEnum(String name, Integer value) {
        this.name = name;
        this.value= value;
    }

    public static DifficultyTypeEnum fromValue(int value) {
        for (DifficultyTypeEnum difficultyType : DifficultyTypeEnum.values()) {
            if (difficultyType.getValue() == value) {
                return difficultyType;
            }
        }
        throw new IllegalArgumentException("Invalid value: " + value);
    }
}
